package cn.xk.basic.listener;

import cn.xk.sys.service.IPermissionService;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
import javax.servlet.annotation.WebServlet;

@WebListener
public class PermissionScanlnitListener implements ServletContextListener {
    @Autowired
    private IPermissionService permissionService;

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        // System.out.println("上下文对象创建成功");
        new Thread(new Runnable() {
            @Override
            public void run() {
                permissionService.scanPermission();
            }
        }).start();
    }
}
